import { View, Language, app, ccclass, modifier } from '../../../extensions/cc-feather/assets/src';
import { BootStage } from './BootStage';
import { MouseClicker } from './MouseClicker';

/**
 * - 作者: DoooReyn
 * - 日期: 2023.11.01
 * - 名称: ApplicationEntry
 * - 描述: 应用组件
 */
@ccclass()
@modifier('ApplicationEntry')
export class ApplicationEntry extends View {
    protected async start() {
        await this.launch({
            appName: '示例应用',
            appVersion: [0, 0, 1],
            languages: [Language.CNS, Language.EN],
            fps: 0,
            fpsApsect: [60, 50, 45],
            isLogEnabled: true,
            isDevVersion: true,
            isShowDevInfo: true,
            preferences: {
                bgmOn: true,
                effectOn: true,
                bgmVolume: 1,
                effectVolume: 1,
            },
            stage: BootStage,
        });
    }

    public async init(): Promise<void> {
        await super.init();
        await MouseClicker.GetInstance().init();
        await app.view.hint.netBusy.register({ path: 'prefab/NetBusyCommon' });
        await app.view.hint.tinyLoading.register({ path: 'prefab/TinyLoadingCommon' });
    }
}
